<?
	require_once("inc_security.php");
	                    
	//khoi tao object Datagird
	$list = new fsDataGird($id_field, $name_field, translate_text("Listing"));
	$form = new form();
	$list->add('pro_name','Tên dự án','string',0,0);
	$list->add('','Hot');
	$list->add('','Trạng thái');
	$list->add("",translate_text("Edit"),"edit");
	$list->add("",translate_text("Delete"),"delete");
	

	$total			= new db_count("SELECT 	count(*) AS count 
											 FROM 	".$fs_table."
											 WHERE 	1 " . $list->sqlSearch());

	$db_listing 	= new db_query("SELECT * 
									 FROM ".$fs_table." 
									 WHERE 1 " . $list->sqlSearch() . "
									 ORDER BY " . $list->sqlSort() . $id_field ." DESC
									 " . $list->limit($total->total));
	$total_row = mysql_num_rows($db_listing->result);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?=$load_header?>
<?=$list->headerScript()?>
<script language="javascript" src="../../resource/js/swfObject.js"></script>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<? /*---------Body------------*/ ?>
<div id="listing">
  <?=$list->showHeader($total_row)?>
	<?
	$i=0; 
	while($row = mysql_fetch_assoc($db_listing->result)){
	$i++;
	?>
  		<?=$list->start_tr($i, $row["pro_id"]);?>
		<td>
			<?=$row['pro_title']?>
		</td>
		<?=$list->showCheckbox('pro_hot',$row['pro_hot'],$row[$id_field])?>
		<?=$list->showCheckbox('pro_active',$row['pro_active'],$row[$id_field])?>
		<?=$list->showEdit($row["pro_id"]); ?>
		<?=$list->showDelete($row["pro_id"]); ?>
  		<?=$list->end_tr();?>
	<?
	}
	?>
  <?=$list->showFooter($total_row)?>
</div>
<? /*---------Body------------*/ ?>
</body>
</html>
